<script>
import BCom from '@/components/b.vue'

export default {
  components: { BCom },
  provide() {
    return {
      count: this.count,
    }
  },
  data() {
    return {
      count: {
        value: 0,
      },
    }
  },
  methods: {
    clickHandle() {
      this.count.value++
    },
  },
}
</script>

<template>
  <div>
    <h3>A组件</h3>
    count: {{ count.value }}
    <button @click="clickHandle">count++</button>

    <BCom />
  </div>
</template>
